home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
pdox693.zip
/
TI499.ASC
< prev
next >
Wrap
Text File
|
1992-08-12
|
2KB
|
67 lines
PRODUCT : Paradox NUMBER : 499
VERSION : All
OS : DOS
DATE : August 12, 1992 PAGE : 1/1
TITLE : USING IMAGECSUM() TO CALCULATE A COLUMN IN A FORM
The following script demonstrates a method for calculating the
total of a particular column in a multi-record form. The example
below illustrates the use of the IMAGECSUM() function.
EDIT "Orders"
PICKFORM 1
WHILE TRUE
WAIT TABLE
PROMPT "PRESS [F2] TO SAVE CHANGES, [ESC] TO CANCEL CHANGES",
"[CTRL] [N] TO CALCULATE TOTAL QUANTITY"
UNTIL "F2", "ESC", 14
SWITCH
CASE RETVAL=14: ;if the user presses Ctrl-N
fld=FIELD() ;sets current field to fld
MOVETO [Quantity Ordered]
x=IMAGECSUM() ;calculates Total Quantity
;Ordered
MESSAGE "The total quantity is ", x, ". Press any key to
continue"
y=GETCHAR()
EXECUTE "MOVETO ["+ fld +"]" ;moves back to original field
CASE RETVAL="Esc": CANCELEDIT QUITLOOP ;cancels edit mode
CASE RETVAL="F2": DO_IT! QUITLOOP ;saves changes
ENDSWITCH
ENDWHILE
DISCLAIMER: You have the right to use this technical information
subject to the terms of the No-Nonsense License Statement that
you received with the Borland product to which this information
pertains.